/*
 * $Id: md5_test.c 3 2007-07-10 06:59:05Z kf701.ye $
 */

#include "factory.h"

int main()
{
	debug_verbose = 4;

	uint8_t str[] = "1234567890";
	uint8_t *digest = MD5_string( str, strlen(str) );
	if( NULL == digest )
	{
		sys_debug("MD5_string err\n");
		return 1;
	}
	uint8_t digest_hex[33] = { 0, };
	bin2hex( digest_hex, digest, 16 );
	sys_debug("MD5(%s): %s\n", str, digest_hex);

	char filename[] = "md5.txt";
	digest = MD5_file( filename );
	if( NULL == digest )
	{
		sys_debug("MD5_file err\n");
		return 1;
	}
	bin2hex( digest_hex, digest, 16 );
	sys_debug("MD5(%s): %s\n", filename, digest_hex);

	return 0;
}
